<!DOCTYPE html>
<html>
<body>
<script src="../../resources/js-test.js"></script>

<div contenteditable>Also bug if moved to here</div>
<div contentEditable>Bug if moved to here</div>
<div id="before" contenteditable>Selection starts here, and should not go out from here</div>
<div contenteditable>Bug if moved to here</div>
<div contenteditable>Also bug if moved to here</div>

<script>
description("Ensure that moving a selection does not skip adjacent contenteditable if the current is contentEditable.");

var before = document.getElementById("before");
var selection = window.getSelection();
selection.collapse(before, 0);
selection.modify("move", "backward", "character");
shouldBe("selection.focusNode", "before");

selection.collapse(before, 1);
selection.modify("move", "forward", "character");
shouldBe("selection.focusNode", "before");
</script>
</body>
</html>
